'use strict';

export default function trademark(state = {}, action) {
  switch (action.type) {
    case 'GET_TRADEMARK_LIST_SUCCESS':
      return { ...state, trademarkList: action.payload };
    case 'GET_TRADEMARK_LIST_FAILURE':
      return { ...state, trademarkList: null, error: action.payload };
      
    case 'GET_TRADEMARK_DETAIL_SUCCESS':
      return { ...state, trademarkDetail: action.payload };
    case 'GET_TRADEMARK_DETAIL_FAILURE':
      return { ...state, trademarkDetail: null, error: action.payload };
      
    case 'ADD_TRADEMARK_SUCCESS':
      return { ...state, addTrademarkResult: action.payload };
    case 'ADD_TRADEMARK_FAILURE':
      return { ...state, addTrademarkResult: null, error: action.payload };
      
    case 'UPDATE_TRADEMARK_SUCCESS':
      return { ...state, updateTrademarkResult: action.payload };
    case 'UPDATE_TRADEMARK_FAILURE':
      return { ...state, updateTrademarkResult: null, error: action.payload };
      
    case 'DELETE_TRADEMARK_SUCCESS':
      return { ...state, deleteTrademarkResult: action.payload };
    case 'DELETE_TRADEMARK_FAILURE':
      return { ...state, deleteTrademarkResult: null, error: action.payload };
      
    case 'BATCH_DELETE_TRADEMARK_SUCCESS':
      return { ...state, batchDeleteTrademarkResult: action.payload };
    case 'BATCH_DELETE_TRADEMARK_FAILURE':
      return { ...state, batchDeleteTrademarkResult: null, error: action.payload };
      
    case 'IMPORT_TRADEMARK_SUCCESS':
      return { ...state, importTrademarkResult: action.payload };
    case 'IMPORT_TRADEMARK_FAILURE':
      return { ...state, importTrademarkResult: null, error: action.payload };
      
    case 'EXPORT_TRADEMARK_SUCCESS':
      return { ...state, exportTrademarkResult: action.payload };
    case 'EXPORT_TRADEMARK_FAILURE':
      return { ...state, exportTrademarkResult: null, error: action.payload };
      
    default:
      return state;
  }
} 